#pragma once

namespace lth
{
	template<class iterator, class ref, class ptr>
	class reverse_iterator
	{
		typedef reverse_iterator<iterator, ref, ptr> self;
		iterator _cur;

		reverse_iterator(iterator it)
			:_cur(it);
		{}

		ref operator*()
		{
			iterator tmp = _cur;
			--tmp;
			return *tmp;
		}

		self& operator++()
		{
			--_cur;
			return *this;
		}

		self& operator--()
		{
			++_cur;
			return *this;
		}

		bool operator!=(const self& s)
		{
			return _cur != s._cur;
		}

	};

}